#include"heap.h"

void test1() {
    Heap hp;
    _HeapCreate(&hp);
    HeapPush(&hp, 4);
    HeapPush(&hp, 18);
    HeapPush(&hp, 42);
    HeapPush(&hp, 12);
    HeapPush(&hp, 21);
    HeapPush(&hp, 3);
    HeapPush(&hp, 5);
    HeapPush(&hp, 5);
    HeapPush(&hp, 50);
    int k = 0;
    scanf("%d", &k);
    while (k--)
    {
    	printf("%d ", HeapTop(&hp));
    	HeapPop(&hp);
    }
    printf("\n");
    
    return 0;
}
int main() {
    test1();
    return 0;
}